Optimal. Leaf size=134 \[ \frac{2 a^3 (c+i d)}{d f (c-i d)^2 (c+d \tan (e+f x))}-\frac{4 a^3 \log (c \cos (e+f x)+d \sin (e+f x))}{f (d+i c)^3}+\frac{4 a^3 x}{(c-i d)^3}-\frac{a (a+i a \tan (e+f x))^2}{2 f (d+i c) (c+d \tan (e+f x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.261881, antiderivative size = 134, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3545, 3542, 3531, 3530} \[ \frac{2 a^3 (c+i d)}{d f (c-i d)^2 (c+d \tan (e+f x))}-\frac{4 a^3 \log (c \cos (e+f x)+d \sin (e+f x))}{f (d+i c)^3}+\frac{4 a^3 x}{(c-i d)^3}-\frac{a (a+i a \tan (e+f x))^2}{2 f (d+i c) (c+d \tan (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3545
Rule 3542
Rule 3531
Rule 3530
Rubi steps
\begin{align*} \int \frac{(a+i a \tan (e+f x))^3}{(c+d \tan (e+f x))^3} \, dx &=-\frac{a (a+i a \tan (e+f x))^2}{2 (i c+d) f (c+d \tan (e+f x))^2}+\frac{(2 a) \int \frac{(a+i a \tan (e+f x))^2}{(c+d \tan (e+f x))^2} \, dx}{c-i d}\\ &=-\frac{a (a+i a \tan (e+f x))^2}{2 (i c+d) f (c+d \tan (e+f x))^2}+\frac{2 a^3 (c+i d)}{(c-i d)^2 d f (c+d \tan (e+f x))}+\frac{(2 a) \int \frac{2 a^2 (c+i d)+2 a^2 (i c-d) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{(c-i d)^2 (c+i d)}\\ &=\frac{4 a^3 x}{(c-i d)^3}-\frac{a (a+i a \tan (e+f x))^2}{2 (i c+d) f (c+d \tan (e+f x))^2}+\frac{2 a^3 (c+i d)}{(c-i d)^2 d f (c+d \tan (e+f x))}-\frac{\left (4 a^3\right ) \int \frac{d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{(i c+d)^3}\\ &=\frac{4 a^3 x}{(c-i d)^3}-\frac{4 a^3 \log (c \cos (e+f x)+d \sin (e+f x))}{(i c+d)^3 f}-\frac{a (a+i a \tan (e+f x))^2}{2 (i c+d) f (c+d \tan (e+f x))^2}+\frac{2 a^3 (c+i d)}{(c-i d)^2 d f (c+d \tan (e+f x))}\\ \end{align*}
Mathematica [B] time = 3.49549, size = 595, normalized size = 4.44 \[ \frac{a^3 \left (\left (c^2+d^2\right ) \cos (e+2 f x) \left (-i c \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )+2 c f x+3 d\right )+\left (c^2+d^2\right ) \cos (e) \left (-2 i c \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )+4 c f x-i c-3 d\right )+4 c^2 d f x \sin (e)+2 c^2 d f x \sin (e+2 f x)+6 c^2 d f x \sin (3 e+2 f x)-i c^3 \cos (3 e+2 f x) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )-2 i c^2 d \sin (e) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )-i c^2 d \sin (e+2 f x) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )-3 i c^2 d \sin (3 e+2 f x) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )-i c^2 d \sin (e)-3 c^3 \sin (e+2 f x)+2 c^3 f x \cos (3 e+2 f x)+3 c^3 \sin (e)-3 c d^2 \sin (e+2 f x)-6 c d^2 f x \cos (3 e+2 f x)+3 i c d^2 \cos (3 e+2 f x) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )-2 i d^3 \sin (e) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )-i d^3 \sin (e+2 f x) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )+i d^3 \sin (3 e+2 f x) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )+3 c d^2 \sin (e)+4 d^3 f x \sin (e)+2 d^3 f x \sin (e+2 f x)-2 d^3 f x \sin (3 e+2 f x)-i d^3 \sin (e)\right )}{2 f (c-i d)^3 (c \cos (e)+d \sin (e)) (c \cos (e+f x)+d \sin (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.041, size = 635, normalized size = 4.7 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.60267, size = 545, normalized size = 4.07 \begin{align*} \frac{\frac{2 \,{\left (4 \, a^{3} c^{3} + 12 i \, a^{3} c^{2} d - 12 \, a^{3} c d^{2} - 4 i \, a^{3} d^{3}\right )}{\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{2 \,{\left (-4 i \, a^{3} c^{3} + 12 \, a^{3} c^{2} d + 12 i \, a^{3} c d^{2} - 4 \, a^{3} d^{3}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{{\left (4 i \, a^{3} c^{3} - 12 \, a^{3} c^{2} d - 12 i \, a^{3} c d^{2} + 4 \, a^{3} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{i \, a^{3} c^{5} + 3 \, a^{3} c^{4} d + 14 i \, a^{3} c^{3} d^{2} - 14 \, a^{3} c^{2} d^{3} - 3 i \, a^{3} c d^{4} - a^{3} d^{5} -{\left (-2 i \, a^{3} c^{4} d - 12 i \, a^{3} c^{2} d^{3} + 16 \, a^{3} c d^{4} + 6 i \, a^{3} d^{5}\right )} \tan \left (f x + e\right )}{c^{6} d^{2} + 2 \, c^{4} d^{4} + c^{2} d^{6} +{\left (c^{4} d^{4} + 2 \, c^{2} d^{6} + d^{8}\right )} \tan \left (f x + e\right )^{2} + 2 \,{\left (c^{5} d^{3} + 2 \, c^{3} d^{5} + c d^{7}\right )} \tan \left (f x + e\right )}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.96756, size = 709, normalized size = 5.29 \begin{align*} \frac{6 \, a^{3} c^{2} + 12 i \, a^{3} c d - 6 \, a^{3} d^{2} + 8 \,{\left (a^{3} c^{2} + a^{3} d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} +{\left (4 \, a^{3} c^{2} + 8 i \, a^{3} c d - 4 \, a^{3} d^{2} +{\left (4 \, a^{3} c^{2} - 8 i \, a^{3} c d - 4 \, a^{3} d^{2}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 8 \,{\left (a^{3} c^{2} + a^{3} d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (\frac{{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right )}{{\left (i \, c^{5} + 5 \, c^{4} d - 10 i \, c^{3} d^{2} - 10 \, c^{2} d^{3} + 5 i \, c d^{4} + d^{5}\right )} f e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (2 i \, c^{5} + 6 \, c^{4} d - 4 i \, c^{3} d^{2} + 4 \, c^{2} d^{3} - 6 i \, c d^{4} - 2 \, d^{5}\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} +{\left (i \, c^{5} + c^{4} d + 2 i \, c^{3} d^{2} + 2 \, c^{2} d^{3} + i \, c d^{4} + d^{5}\right )} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.5164, size = 637, normalized size = 4.75 \begin{align*} -\frac{2 \,{\left (\frac{4 \, a^{3} \log \left (-i \, \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1\right )}{i \, c^{3} + 3 \, c^{2} d - 3 i \, c d^{2} - d^{3}} - \frac{2 \, a^{3} \log \left ({\left | c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 2 \, d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - c \right |}\right )}{i \, c^{3} + 3 \, c^{2} d - 3 i \, c d^{2} - d^{3}} - \frac{3 \, a^{3} c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} - 3 i \, a^{3} c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 13 \, a^{3} c^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 3 i \, a^{3} c^{2} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - a^{3} c d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 7 \, a^{3} c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 6 i \, a^{3} c^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 12 \, a^{3} c^{2} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 6 i \, a^{3} c d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + a^{3} d^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 3 i \, a^{3} c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 13 \, a^{3} c^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 3 i \, a^{3} c^{2} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + a^{3} c d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 3 \, a^{3} c^{4}}{{\left (-i \, c^{5} - 3 \, c^{4} d + 3 i \, c^{3} d^{2} + c^{2} d^{3}\right )}{\left (c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 2 \, d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - c\right )}^{2}}\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]